<?php
namespace app\api\model;
use think\Model;

class Order extends Model
{
    protected $autoWriteTimestamp = true;
	protected $updateTime = false;
    protected $pk = 'id';
    

    // 关联供应商
    public function fsupplier() {
        return $this->hasOne('\app\api\model\Supplier','id','supplier_id')->bind(
            ['gys' => 'name']);
    }

    // 关联仓库
    public function fwarehouse() {
        return $this->hasOne('\app\api\model\Warehouse','id','warehouse_id')->bind(
            ['ck' => 'name']);
    }
}

